package com.example.myworkc;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.app.Fragment;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class findBlankFragment extends Fragment {
    private Button buttonBind,buttonUnbind;
    private Intent intent;
    private   MyService1.MyBinder mybinder;
    private Context context;
    private ServiceConnection connection;
    public findBlankFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.find_blank, container, false);
        String[] name={"朋友圈","视频号","购物","小程序"};
        int[] png={R.drawable.pyq, R.drawable.sph,R.drawable.gw, R.drawable.xcx};
        List<Map<String, Object>> listitem = new ArrayList<Map<String, Object>>();
        for (int i = 0; i < name.length; i++) {
            Map<String, Object> showitem = new HashMap<String, Object>();
            showitem.put("png", png[i]);
            showitem.put("name", name[i]);
            listitem.add(showitem);
        }
        SimpleAdapter myAdapter = new SimpleAdapter(view.getContext(), listitem, R.layout.item3, new String[]{"png", "name"}, new int[]{R.id.imageView_find, R.id.textView_find});
        ListView listView = view.findViewById(R.id.list_view_find);
        listView.setAdapter(myAdapter);
        return view;

    }

}